/*
 * Project: BoboDesignPattern
 * 
 * File Created at 2016年6月16日
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package simplefactory;

/**
 * @Type SimpleFactory
 * @Desc
 * @author boboge
 * @date 2016年6月16日
 * @Version V1.0
 */
public class SimpleFactory {

    public static AbstractCatchPattern createCatchPattern(String pattern) {
        AbstractCatchPattern catchPattern = null;
        switch (pattern) {
        case "beginEnd":
            catchPattern = new BeginEndCatchPattern();
            break;
        case "fixed":
            catchPattern = new FixedCatchPattern();
            break;
        case "regex":
            catchPattern = new RegexCatchPattern();
            break;
        }
        return catchPattern;

    }

}
